package com.pro.common.service.admin.enums.init;

import com.pro.common.service.admin.enums.*;
import com.pro.common.service.admin.model.db.*;
import com.pro.framework.api.enums.IEnumToDbEnum;
import com.pro.framework.javatodb.annotation.JTDField;
import com.pro.framework.javatodb.constant.JTDConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@Schema(description = "调度任务信息")
public enum EnumXxlJobInfo implements IEnumToDbEnum<XxlJobInfo> {
    _1(
            5,
            "店铺日数据清零",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 0 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopShopInfoDailyClear",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),

    _101(
            3,
            "批量同步数据-订单",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopDataSyncRowOrder",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _102(
            3,
            "批量同步数据-商品",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopDataSyncRowProduct",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _103(
            3,
            "批量同步数据准备处理-订单",
            "admin",
            null,
            EnumScheduleType.CRON,
            "15/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopDataSyncRowInitOrder",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _104(
            3,
            "批量同步数据准备处理-商品",
            "admin",
            null,
            EnumScheduleType.CRON,
            "15/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopDataSyncRowInitProduct",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _105(
            3,
            "定时拉取平台产品或订单",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 0 0 7,11,16,19,23 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleShopDataSyncOrderOrProduct",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),

    _201(
            2,
            "认领后-模糊匹配类目-shein",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "queryCatSuggestShein",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _202(
            4,
            "认领后-模糊匹配类目-temu",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "queryCatSuggestTemu",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _203(
            6,
            "认领后-模糊匹配类目-tiktok",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "queryCatSuggestTiktok",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _301(
            2,
            "将商品数据发布到-shein",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "publishProductsToShein",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _302(
            4,
            "将商品数据发布到-temu",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 0 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "publishProductsToTemu",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _303(
            6,
            "将商品数据发布到-tiktok",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 0 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "publishProductsToTiktok",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _401(
            7,
            "主账号日数据清零",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 0 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "handleUserUserInfoDailyClear",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),


    _501(
            2,
            "定时任务-上下架-准备",
            "admin",
            null,
            EnumScheduleType.CRON,
            "10/20 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "SheinProductAddToShelfJob_prepare",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _502(
            2,
            "定时任务-上下架-执行",
            "admin",
            null,
            EnumScheduleType.CRON,
            "10/20 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "SheinProductAddToShelfJob_execute",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _601(
            4,
            "定时增量拉取temu产品",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 6,10,15,18,22 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "DealOrderOrProductTempProduct",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _602(
            4,
            "定时增量拉取temu订单",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 7,11,16,19,23 * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "DealOrderOrProductTempOrder",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _1301(
            2,
            "定时任务-上下架-执行",
            "admin",
            null,
            EnumScheduleType.CRON,
            "10/20 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "SheinProductAddToShelfJob_execute",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _1401(
            2,
            "更新或者复制更新_ILaunchGoodsSkuRecord表的outId_方便查询货源价格",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/10 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "DealSkuSourcePriceTempJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _20001(
            7,
            "检查用户套餐和配额过期",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "UserPackageExpireJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _20002(
            7,
            "主套餐配额数量每月重置",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/30 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "UserPackagePrimaryMonthResetJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _30001(
            8,
            "退还采集失败的配额",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "RefundQuotaPlusCollectGoodsItemJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _30002(
            8,
            "采集成功的处理",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 0 * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "FinishQuotaPlusCollectGoodsItemJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _30003(
            8,
            "v1采集第一步",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 */5 * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "collectPreTask",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _30004(
            8,
            "v2采集第一步",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 */5 * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "collectTask",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _40001(
            9,
            "定时任务-拼图批处理任务-1",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "ContentProcessImageStitchingJob_handleStep1",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _40002(
            9,
            "定时任务-拼图批处理任务-2",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "ContentProcessImageStitchingJob_handleStep2",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    _40003(
            9,
            "定时任务-拼图批处理任务-3",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "ContentProcessImageStitchingJob_handleStep3",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
//    _30002(
//            7,
//            "退还采集失败的配额_清理缓存",
//            "admin",
//            null,
//            EnumScheduleType.CRON,
//            "0/60 * * * * ?",
//            EnumMisfireStrategy.DO_NOTHING,
//            EnumExecutorRouteStrategy.FIRST,
//            "RefundQuotaPlusCollectGoodsItemJobEvict",
//            null,
//            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
//            null,
//            null,
//            EnumGlueType.BEAN,
//            null,
//            null,
//            "1970-01-01 00:00:00",
//            null,
//            null,
//            null,
//            null,
//            null
//    ),


    _50001(
            2,
            "分批次_更新launch_collect_product_sku_shein表.source_price等",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/3 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "LaunchCollectProductSkuSheinJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),

    _50002(
            2,
            "分批次_更新launch_collect_product_sku_record_shein表.source_price等",
            "admin",
            null,
            EnumScheduleType.CRON,
            "0/3 * * * * ?",
            EnumMisfireStrategy.DO_NOTHING,
            EnumExecutorRouteStrategy.FIRST,
            "LaunchCollectProductSkuRecordSheinJob",
            null,
            EnumExecutorBlockStrategy.SERIAL_EXECUTION,
            null,
            null,
            EnumGlueType.BEAN,
            null,
            null,
            "1970-01-01 00:00:00",
            null,
            null,
            null,
            null,
            null
    ),
    ;


    @Schema(description = "执行器主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Integer jobGroup;

    @Schema(description = "任务描述", requiredMode = Schema.RequiredMode.REQUIRED)
    private final String jobDesc;

    @Schema(description = "作者")
    private final String author;

    @Schema(description = "报警邮件")
    private final String alarmEmail;

    @Schema(description = "调度类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @JTDField(type = JTDConst.EnumFieldType.int_, defaultValue = "0", entityClassKey = "value")
    private final EnumScheduleType scheduleType;

    @Schema(description = "调度配置，值含义取决于调度类型")
    private final String scheduleConf;

    @Schema(description = "调度过期策略", requiredMode = Schema.RequiredMode.REQUIRED)
    @JTDField(type = JTDConst.EnumFieldType.int_, defaultValue = "0", entityClassKey = "value")
    private final EnumMisfireStrategy misfireStrategy;

    @Schema(description = "执行器路由策略")
    @JTDField(type = JTDConst.EnumFieldType.int_, defaultValue = "0", entityClassKey = "value")
    private final EnumExecutorRouteStrategy executorRouteStrategy;

    @Schema(description = "执行器任务handler")
    private final String executorHandler;

    @Schema(description = "执行器任务参数")
    private final String executorParam;

    @Schema(description = "阻塞处理策略")
    @JTDField(type = JTDConst.EnumFieldType.int_, defaultValue = "0", entityClassKey = "value")
    private final EnumExecutorBlockStrategy executorBlockStrategy;

    @Schema(description = "任务执行超时时间，单位秒", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Integer executorTimeout;

    @Schema(description = "失败重试次数", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Integer executorFailRetryCount;

    @Schema(description = "GLUE类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @JTDField(type = JTDConst.EnumFieldType.int_, defaultValue = "0", entityClassKey = "value")
    private final EnumGlueType glueType;

    @Schema(description = "GLUE源代码")
    private final String glueSource;

    @Schema(description = "GLUE备注")
    private final String glueRemark;

    @Schema(description = "GLUE更新时间")
    private final String glueUpdatetime;

    @Schema(description = "子任务ID，多个逗号分隔")
    private final String childJobid;

    @Schema(description = "调度状态：0-停止，1-运行", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Integer triggerStatus;

    @Schema(description = "上次调度时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Long triggerLastTime;

    @Schema(description = "下次调度时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private final Long triggerNextTime;

    /**
     * 统一重置修改掉,这个配置时间以前的,旧的配置
     */
    private final String forceChangeTime;
}
